package com.my.fo.strategy.organization.existType;

import cn.hutool.core.io.FileUtil;
import com.my.fo.strategy.organization.inter.OrganizationExistTypeStrategy;
import com.my.fo.strategy.interfaces.StrategyFactoryName;

import java.io.File;

@StrategyFactoryName("leaveLarger")
public class LeaveLargerOrganizationExistTypeStrategy implements OrganizationExistTypeStrategy {

    @Override
    public boolean handlerExist(String inputSrc, String outputSrc) {
        return FileUtil.size(FileUtil.file(inputSrc)) > FileUtil.size(FileUtil.file(outputSrc));
    }

    @Override
    public boolean handlerExist(File inputFile, File outputFile) {
        return FileUtil.size(inputFile) < FileUtil.size(outputFile);
    }

}
